﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using blackhouse.BlackApart.Business.Apartments;

namespace blackhouse.BlackApart.Business.Calendar {
    public class ApartmentTypeCalendar : ICalendar {

        #region Fields

        private int apartmentTypeId;
        private AvabilityOfApartmentTypes freePlacesInApartments;

        #endregion

        #region Properties

        public DateTime FromDay {
            get;
            private set;
        }

        public DateTime ToDay {
            get;
            private set;
        }

        #endregion

        #region Constructors

        public ApartmentTypeCalendar(int groupId, DateTime fromDay, DateTime toDay) {
            this.apartmentTypeId = groupId;
            this.FromDay = fromDay;
            this.ToDay = toDay;

            this.freePlacesInApartments = Factory.Instance().GetAvabilityOfApartmentTypes(groupId, fromDay, toDay);
        }

        #endregion

        #region Methods

        public int GetDayState(DateTime day) {
            return this.freePlacesInApartments.GetAvabilityForDay(day);
        }

        #endregion

    }
}
